
import getTemplate from '../request-functions/getTemplate';

export default function() {
    let {
        func_type,
        param_str,
        pk_org,
        updateState
    } = this.props;

    let postData = {
        func_type,
        param_str,
        pk_org
    };

    getTemplate(postData)
        .then((res) => {
            this.setState({
                selectOptions: res.data.opts,
                selectValue: res.data.opts[0].value,
                currentForm: res.data.opts[0].value
            }, () => {
                this.renderForm();
            });
        })
        .catch((e) => {
            updateState({
                batchAddSubVisible: false
            });
        });
}
